//显示成功
const Success = (message, callback, noIcon) => {
	if (noIcon === true) {
		uni.showToast({
			title: message,
			icon: 'none',
			success() {
				callback && (setTimeout(() => {
					callback();
				}, 500));
			}
		})
		return false;
	}
	uni.showToast({
		title: message,
		icon: "success",
		icon: 'none',
		success() {
			callback && (setTimeout(() => {
				callback();
			}, 500));
		}
	})
}
//显示失败
const Fail = (message, callback) => {
	let lang = uni.getStorageSync('_language') || 'tc';
	uni.showModal({
		// title: "hint",
		content: message,
		showCancel: false,
		confirmText: lang == 'tc' ? '確定':'know',
		success(res) {
			//console.log('yes');
			callback && callback(res);
		}
	})
}
//显示选择
const Confirm = (msg, cancelText, confirmText, callback) => {
	uni.showModal({
		title: "hint",
		content: msg,
		showCancel: true,
		cancelText: cancelText,
		confirmText: confirmText,
		success(res) {
			// console.log(res)
			callback && callback(res);
		}
	})
}

module.exports = {
	Success: Success,
	Fail: Fail,
	Confirm: Confirm,
}